<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>商户名称</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telephone=no, email=no" />
    <link href="css/base.css" type="text/css" rel="stylesheet">
    <link href="css/common.css" type="text/css" rel="stylesheet">
    <script src="js/jquery.js"></script>
    <script src="js/common.js"></script>
    <script>
        $(function () {
            getScriptData("business/detail?callback=showMerchant&id="+getLocationKey("id",1));
        });
        function showMerchant(data){
			if(scriptFlag){
				data = data.data;
				loadingEnd();
			}
            $(".pic").attr("src",data.pic);
            $(".merchant h1").html(data.name);
            $(".merchant .info").html(data.intro);
            $(".address .right").html(data.address);
            $(".tel .right").html(data.tel);
            var products = data.products;
            var productStr = '';
            $.each(products,function(index,obj){
                productStr += '<li data-go="'+htmlObj.goods+'-'+obj.id+'">';
                var pic = imgObj.goods;
                try{
                    pic = obj.pic.split(",")[0];
                }catch(e){}
                productStr += '<img src="'+pic+'" onerror="this.src=\''+imgObj.goods+'\';this.onerror=null;" />';
                productStr += '<p>'+obj.name+'</p>';
                productStr += '<p class="price">￥'+obj.newPrice.toFixed(2);
                productStr += '<span>￥'+obj.price.toFixed(2)+'</span>';
                productStr += '</p>';
                productStr += '</li>';
            });
            $(".goods ul").html(productStr);
            var activities = data.activities;
            var activityStr = '';
            $.each(activities,function(index,obj){
                activityStr += '<div class="activity-list" data-go="'+htmlObj.activity+'-'+obj.id+'">';
                activityStr += '<img src="'+obj.pic+'" onerror="this.src=\''+imgObj.activity+'\';this.onerror=null;" />';
                activityStr += '<div class="name">';
                activityStr += '<p>'+obj.name+'</p>';
                var modifyTime = "";
                try{
                    modifyTime = obj.modifyTime.split(" ")[0];
                }catch(e){}
                activityStr += '<span>'+modifyTime+'</span>';
                activityStr += '</div>';
                activityStr += '</div>';
            });
            $(".activity").html(activityStr);
            $(".goods-all a").attr("data-go",htmlObj.allGoods+"-"+data.id);
        }
    </script>
</head>
<body>
    <div class="merchant">
        <img class="pic" />
        <div class="introduction">
            <h1></h1>
            <p class="info"></p>
            <p class="line"></p>
            <p class="address">
                <span>地址：</span>
                <span class="right"></span>
            </p>
            <p class="tel">
                <span>电话：</span>
                <span class="right"></span>
            </p>
        </div>
    </div>
    <div class="title">商户商品</div>
    <div class="goods">
        <ul>
        </ul>
        <div class="goods-all">
            <a>点击查看全部商品&gt;</a>
        </div>
    </div>
    <div class="title">商户活动</div>
    <div class="activity">
    </div>
</body>
</html>